/**
 * @Description: test
 * @Author: Hu Outstanding
 * @Date: 2022/2/23 20:30
 */
package com.aaa.three.controller;

        import com.aaa.three.aop.Log;
        import com.aaa.three.pojo.domain.AddRole;
        import com.aaa.three.pojo.domain.AdminRolePermission;
        import com.aaa.three.pojo.domain.RolePer;
        import com.aaa.three.pojo.domain.UpdateRole;
        import com.aaa.three.result.AjaxResult;
        import com.aaa.three.service.AdminQueryRoleService;
        import org.springframework.beans.factory.annotation.Autowired;
        import org.springframework.web.bind.annotation.PathVariable;
        import org.springframework.web.bind.annotation.RequestMapping;
        import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("role")
public class AdminQueryRoleController {

    @Autowired
    private AdminQueryRoleService adminQueryRole;


    @RequestMapping("queryRole")
    public AjaxResult queryRole(){
        return adminQueryRole.queryRole();
    }

    @RequestMapping("getRole/{id}")
    public AjaxResult getRole(@PathVariable("id") int id){
        return adminQueryRole.getRole(id);
    }

    @RequestMapping("queryPermissionState/{id}")
    public AjaxResult queryPermissionState(@PathVariable("id") int id){
        return adminQueryRole.queryPermissionState(id);
    }

    @RequestMapping("getPoption")
    public AjaxResult getPoption(){
        return adminQueryRole.getPoption();
    }

    @RequestMapping("querySOption/{id}")
    public AjaxResult querySOption(@PathVariable("id") int id){
        return adminQueryRole.querySOption(id);
    }

    @RequestMapping("queryPpermission")
    public AjaxResult queryPpermission(){
        return adminQueryRole.queryPpermission();
    }

    @RequestMapping("updateRole")
    @Log("修改角色权限")
    public AjaxResult updateRole(RolePer rolePer){
        return adminQueryRole.updatePer(rolePer);
    }

    @RequestMapping("listPermission/{getPpermission}")
    public AjaxResult listPermission(@PathVariable("getPpermission") int id){
        return adminQueryRole.listPermission(id);
    }

    @RequestMapping("updateRoleInfo")
    @Log("修改角色信息")
    public AjaxResult updateRoleInfo(AdminRolePermission adminRolePermission){
        return adminQueryRole.updateRoleInfo(adminRolePermission);
    }
    @RequestMapping("addRole")
    @Log("添加角色")
    public AjaxResult addRole(AddRole addRole){
        return adminQueryRole.addRole(addRole);
    }

}
